package de.lang.rollo.test.mongodb;


import org.mongojack.ObjectId;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pi4j.io.gpio.Pin;

public class Schalter {


	private String id;

	@JsonSerialize(using = PinSerializer.class)
	@JsonDeserialize(using = PinDeserializer.class)
	public Pin pin;
	
	public SchalterType type;

	public String name;
	
	public RolloMotor motor;
	

	@JsonIgnore
	public int pressCounter = 0;
	
	public void incrementCounter(){
		pressCounter++;
	}
	
	public void resetCounter(){
		pressCounter = 0;
	}
	
	@ObjectId
	public String getId() {
		return id;
	}

	@ObjectId
	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Pin getPin() {
		return pin;
	}

	public void setPin(Pin pin) {
		this.pin = pin;
	}

	public RolloMotor getMotor() {
		return motor;
	}

	public void setMotor(RolloMotor motor) {
		this.motor = motor;
	}

	public SchalterType getType() {
		return type;
	}

	public void setType(SchalterType type) {
		this.type = type;
	}
	
	
	
}
